"use strict"

import {resolve} from "path"
import {defineConfig} from "vite"
import vue from "@vitejs/plugin-vue"
import AutoImport from "unplugin-auto-import/vite";
import vueJsx from '@vitejs/plugin-vue-jsx';

export default defineConfig({
    plugins: [vueJsx(), vue(), AutoImport({imports: ["vue", "vue-router", "pinia"], dts: true})],
    css: {
        preprocessorOptions: {
            scss: {api: 'modern-compiler'},
        }
    },
    resolve: {
        alias: {
            "@": resolve(__dirname, "src"),
        }
    },
    base: "/static/dist/",
    server: {
        port: 3000,
        open: true,
        proxy: {
            "/api": {
                target: "http://localhost:8081",
                changeOrigin: true,
                rewrite: (path) => path.replace(/^\/api/, ""),
            },
        },
    },
})
